package com.starlink.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.starlink.model.request.mall.FreeTemplateInfoRequest;
import com.starlink.model.vo.book.FreeCarryModeInfoVO;
import com.starlink.model.vo.book.FreeTemplateInfoVO;
import org.springframework.data.domain.Pageable;
import com.starlink.model.domain.FreeTemplateDO;
import com.starlink.model.request.FreeTemplateRequest;
import com.starlink.model.vo.FreeTemplateVO;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author zhanghong
 */
public interface FreeTemplateService extends IService<FreeTemplateDO> {

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    FreeTemplateVO getByKey(long id);
    /**
     * 分页查询，手动分页
     * @param request
     * @return
     */
    PageInfo<FreeTemplateVO> pageQuery(Pageable pageable,FreeTemplateRequest request);
    /**
     * 列表查询
     * @param request
     * @return
     */
    List<FreeTemplateVO> listQuery(FreeTemplateRequest request);
    /**
     * 新增
     * @param request
     * @return
     */
    Boolean add(FreeTemplateRequest request);
    /**
     * 根据主键更新
     * @param request
     * @return
     */
    Boolean updateByKey(FreeTemplateRequest request);
    /**
     * 根据主键删除
     * @param ids
     * @return
     */
    Boolean deleteDOByIds(String ids);

    /**
     * 根据模板ID查询运费模板相关信息
     * @param freeTemplateId
     * @return
     */
    FreeTemplateInfoVO selectFreeTempInfoByFreeTemplateId(Long freeTemplateId);

    /**
     * 查询默认运费
     * @return
     */
    FreeCarryModeInfoVO selectDefultTempInfo();

    PageInfo<List<FreeTemplateVO>> pagingQuery(FreeTemplateRequest request, Pageable pageable);

    Boolean editing(FreeTemplateInfoRequest request);

    Boolean deleteDOById(String ids);
}
